<template>
  <div>
    <DogList
      v-for="(item, index) in dogList"
      :key="index"
      :index="index"
      :dogImgUrl="item.dogImgUrl"
      :dogName="item.dogName"
      @subdogList="dlClickdeFn"
    />
    您喜欢的狗如下：
    <ul>
      <li v-for="(item, index) in dlClickde" :key="index">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
import DogList from "./components/DogList.vue";
export default {
  components: {
    DogList,
  },
  data() {
    return {
      dogList: [
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "博美",
        },
        {
          dogImgUrl:
            "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1224576619,1307855467&fm=26&gp=0.jpg",
          dogName: "泰迪",
        },
        {
          dogImgUrl:
            "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2967740259,1518632757&fm=26&gp=0.jpg",
          dogName: "金毛",
        },
        {
          dogImgUrl:
            "https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c",
          dogName: "哈士奇",
        },
        {
          dogImgUrl:
            "https://ss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/1c950a7b02087bf4b9cb0864f4d3572c11dfcf1c.jpg",
          dogName: "阿拉斯加",
        },
        {
          dogImgUrl:
            "https://pic.rmb.bdstatic.com/c9a858535d3c35bde1e1469d1f0e2cb6.jpeg@wm_2,t_55m+5a625Y+3L+WuoOeJqemlsuWFu+WRmOaxn+axnw==,fc_ffffff,ff_U2ltSGVp,sz_26,x_17,y_17",
          dogName: "萨摩耶",
        },
      ],
      dlClickde: [],
    };
  },
  methods: {
    dlClickdeFn(i) {
      //   console.log(i);
      //   console.log(this.dogList[i]);
      this.dlClickde.push(this.dogList[i].dogName);
    },
  },
};
</script>

<style></style>
